<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>月护理查询</title>
		<%include("/common/include.html"){}%>
		<link rel="stylesheet" href="${cxt!}/sb/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
		<style type="text/css">
			.textbox{
				padding-right:0px;
				background:url("${cxt !}/sb/themes/insdep/images/combo_arrow.png") no-repeat scroll right center transparent;
			} 
		</style>
	</head>
	<body class="easyui-layout">
		
	<div data-options="region:'north',split: true,title:'快速查询'" style="height: 200px; padding: 10px;">
		<form id="monthNursing_form"  action="${cxt!}/monthNursing/excel">
			<div style="margin-bottom: 10px; float: left; margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">开始时间</label>
<!-- 				<input  id="monthNursing_datebox" name="_query.yearmonth" value='${date()}' class="easyui-datebox theme-textbox-radius" -->
<!-- 					style="height: 32px; width: 212px; text-align: center"    /> -->
				<input id="monthNursing_datebox" name="_query.year" class="easyui-numberspinner theme-textbox-radius" style="width:212px;height: 32px;text-align: center;" value='${date(),dateFormat="yyyy"}' data-options="min:1990,editable:false,label:'年'" labelPosition="after">
			</div>
			<div style="margin-bottom: 10px; float: left; margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">代理商/门店</label>
				<input id="organ" type="text" readonly style="width: 200px; height: 30px; padding-left: 10px; text-align: center"
					onclick="showMenu(); return false;" class="textbox theme-textbox-radius" value="${organization.name! }" />
				<input name="_query.organIds" id="organIds" type="hidden" value="${organization.ids! }">
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">顾客姓名</label>
				<input  id="cusname" name="_query.cusname" class=" easyui-textbox theme-textbox-radius" style="width:212px;height:32px;text-align:center"/>
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">顾客手机号</label>
				<input  id="cusphone" name="_query.cusphone" class=" easyui-textbox theme-textbox-radius" style="width:212px;height:32px;text-align:center"/>
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">会员编号</label>
				<input  id="cushybh" name="_query.cushybh" class=" easyui-textbox theme-textbox-radius" style="width:212px;height:32px;text-align:center"/>
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">是否达到标体</label>
				<select name="_query.isdb" id="isdb" class="easyui-combobox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
						<option value=" ">全部</option>
						<option value="1">是</option>
						<option value="0">否</option>
				</select>
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">最少减重次数：</label>
				<input name="_query.minDelweightnum" id="minDelweightnum" class="easyui-textbox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
			</div>
			
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">最多减重次数：</label>
				<input name="_query.maxDelweightnum" id="maxDelweightnum" class="easyui-textbox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">最小减重效果</label>
				<input name="_query.minJzxg" id="minJzxg" class="easyui-textbox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">最大减重效果</label>
				<input name="_query.maxJzxg" id="maxJzxg" class="easyui-textbox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
			</div>
			<div style="margin-bottom: 10px;float:left;margin-right: 10px;">
				<label class="label-top" style="width: 100%; display: block;">疗程数：</label>
				<input name="_query.lcs" id="lcs" class="easyui-textbox theme-textbox-radius" style="height:32px;width:212px;text-align:center">
			</div>
			<div style="margin-bottom: 10px; float: left; margin-top: 16px; margin-right: 10px;">
				<a href="#" onclick='searchFrom()' class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width: 212px">搜索</a>
			</div>
			<div style="margin-bottom: 10px;float:left;margin-top: 16px;margin-right: 10px;">
				<a href="#" onclick='customerInfo_xls()' class="easyui-linkbutton" data-options="iconCls:'icon-pageexcel'" style="width:212px">导出</a>
			</div>
		</form>
	</div>			
	
	<div data-options="region:'center'" style="overflow-x:hidden;">
		<p style="height: 10px;"></p>
		<table id="monthNursing_datagrid" class="easyui-datagrid" style="width:100%;height:97%">
				
		</table>
		<div id="tb" style="height:17px;">
			<p align="left">(备注: <font color=red>红色</font>代表30%以下  &nbsp;&nbsp; 
			<font color=pink>粉色</font>代表30%-40%&nbsp;&nbsp;
			<font color=purple>紫色</font>代表40%-50%&nbsp;&nbsp;
			<font color="#90dff9">浅蓝色</font>代表50%-60%&nbsp;&nbsp;
			<font color=blue>深蓝色</font>代表60%-70%&nbsp;&nbsp;
			<font color="#90f977">浅绿色</font>代表70%-80%&nbsp;&nbsp;
			<font color=green>深绿色</font>代表80%以上 名字绿色代表到达标体)</p>
		</div>
	</div>
	<div id="menuContent" class="menuContent" style="display: none; position: absolute;z-index: 10;">
		<ul id="organSelectTree" class="ztree" style="margin-top:0;width: 200px;"></ul>
	</div>
			
	<script type="text/javascript">
			//查看顾客详细信息
			function lookCustomerInfo(ids){
				loadViewDialog('查看顾客详细信息', '${cxt !}/customerInfoStatistic/lookCustomerInfo?ids='+ids);
			}
			function customerInfo_xls(){
				$('#monthNursing_form').submit();
// 				var monthNursing_datebox = $("#monthNursing_datebox").val();
// 				var organIds = $("#organIds").val();
// 				var cusname = $("#cusname").val();
// 				var cusphone = $("#cusphone").val();
// 				var cushybh = $("#cushybh").val();
// 				var isdb = $("#isdb").combobox("getValue");
// 				var minDelweightnum = $("#minDelweightnum").val();
// 				var maxDelweightnum = $("#maxDelweightnum").val();
// 				var minJzxg = $("#minJzxg").val();
// 				var maxJzxg = $("#maxJzxg").val();
// 				var url = "${cxt!}/monthSalesStatistic/excel?monthNursing_datebox=" + monthNursing_datebox + "&organIds=" + organIds
// 						+"&cusname="+cusname+"&cusphone="+cusphone+"&cushybh="+cushybh+"&isdb="+isdb+"&minDelweightnum="+minDelweightnum
// 						+"&maxDelweightnum="+maxDelweightnum+"&minJzxg="+minJzxg+"&maxJzxg="+maxJzxg;
// 				window.location.href = url;
			}
	</script>
	<script type="text/javascript">
			var organIds=$('#organIds').val();
			var setting = {
				async : {
					enable : true,
					url : '${cxt!}/common/getOrgenTree',
					autoParam : [ "id=ids" ],//, "name=n", "level=lv"
					otherParam : {
						"organIds" : organIds
					},
					type : "post"
				},
				view : {
					dblClickExpand : false
				},
				data : {
					simpleData : {
						enable : true
					}
				},
				callback : {
					onClick : onClick,
					onAsyncSuccess : organTreeOnAsyncSuccess
				}
			};
			var flag=0;//只初始化一次标识
			function organTreeOnAsyncSuccess(event, treeId, msg) {
				if(flag == 0){
					var organTree = $.fn.zTree.getZTreeObj("organSelectTree");
					var nodes = organTree.getNodes();
					flag = 1;
				}
			}
			function onClick(e, treeId, treeNode) {
				var zTree = $.fn.zTree.getZTreeObj("organSelectTree");
				var path = "";
				var sNodes = zTree.getSelectedNodes();
				if (sNodes.length > 0) {
					var node = sNodes[0].getPath();
					for(var i =0;i<node.length;i++){
						if(i == (node.length-1)){
							path += node[i].name;
						}else{
							path += node[i].name + "/";
						}
						
					}
				}
				var cityObj = $("#organ");
				cityObj.attr("value", path);
				$("#organIds").attr("value", treeNode.id);
				hideMenu();
			}
			function showMenu() {
				var cityObj = $("#organ");
				var cityOffset = $("#organ").offset();
				$("#menuContent").css({
					left : cityOffset.left + "px",
					top : cityOffset.top + cityObj.outerHeight() + "px"
				}).slideDown("fast");
				$("body").bind("mousedown", onBodyDown);
			}
			function hideMenu() {
				$("#menuContent").fadeOut("fast");
				$("body").unbind("mousedown", onBodyDown);
			}
			function onBodyDown(event) {
				if (!(event.target.id == "menuBtn"
						|| event.target.id == "menuContent" || $(event.target)
						.parents("#menuContent").length > 0)) {
					hideMenu();
				}
			}
			$.fn.zTree.init($("#organSelectTree"), setting);
		</script>
		<script src="sb/js/statistic/monthNursing/monthNursing.js" type="text/javascript" charset="utf-8"></script>
	</body>
</html>
